add_definitions("-DAISDK_LOG_MODULE=MessageProxy")

if (NOT LIBWEBSOCKETS_INCLUDE_DIRS OR NOT LIBWEBSOCKETS_LIBRARIES)
	#find_package(libwebsockets REQUIRED)
endif()

#find_package(LibIOCTL)

message(STATUS "libwebsockets_DIR = ${libwebsockets_DIR}")
message(STATUS "LIBWEBSOCKETS_INCLUDE_DIRS = ${LIBWEBSOCKETS_INCLUDE_DIRS}")
message(STATUS "LIBWEBSOCKETS_LIBRARIES = ${LIBWEBSOCKETS_LIBRARIES}")

#link_directories(${OPENSSL_LIB_PATH} ${LIBWEBSOCKETS_LIBRARIES})
include_directories("${LIBWEBSOCKETS_INCLUDE_DIRS}")

#add_library(MessageProxyStatic STATIC
#	BloodGeneratorModule.cpp
#	PulseTakingModule.cpp
#      	RtspModule.cpp 
#	MessageProxyImpl.cpp  
#	MessageProxy.cpp  
#	ModulesProxy.cpp  
#      	UserSideData.cpp
#       	UMMsgMap.cpp
#	IModule.cpp  
#	Directive.cpp)

add_library(MessageProxyStatic STATIC
	cJSON.c
	cJSON_Utils.c
	JSONUtils.cpp
	MessageProxyImpl.cpp
        MessageProcessing.cpp	
)

add_library(MessageProxy SHARED
	#	BloodGeneratorModule.cpp
	#	PulseTakingModule.cpp
	#RtspModule.cpp 
	#MessageProxyImpl.cpp  
	cJSON.c
	cJSON_Utils.c
	MessageProxyImpl.cpp  
	MessageProcessing.cpp
	#ModulesProxy.cpp  
	#UserSideData.cpp
	#UMMsgMap.cpp
	#IModule.cpp  
	#Directive.cpp
	)


target_include_directories(MessageProxyStatic PUBLIC
	${MessageProxy_SOURCE_DIR}/interface
	${MessageProxy_SOURCE_DIR}/include
	${ULCCommon_SOURCE_DIR}/Utils/include
	${ULCDeviceSDK_SOURCE_DIR}/ThirdParty/MQ/include
	${ULCDeviceSDK_SOURCE_DIR}/ThirdParty/nonstd
	${ULCDeviceSDK_SOURCE_DIR}/ThirdParty
	${OPENSSL_INCLUDE_DIR}
	)

target_include_directories(MessageProxy PUBLIC
	${MessageProxy_SOURCE_DIR}/interface
	${MessageProxy_SOURCE_DIR}/include
	${ULCCommon_SOURCE_DIR}/Utils/include
	${ULCDeviceSDK_SOURCE_DIR}/ThirdParty/MQ/include
	${ULCDeviceSDK_SOURCE_DIR}/ThirdParty/nonstd
	${ULCDeviceSDK_SOURCE_DIR}/ThirdParty
	${LIBWEBSOCKETS_INCLUDE_DIR}
	${OPENSSL_INCLUDE_DIR}
	)

target_link_libraries(MessageProxyStatic
		${LIBWEBSOCKETS_LIBRARIES}/libwebsockets.a
		${LIBCAP_LIB_PATH}/libcap.a
		${OPENSSL_LIB_PATH}/libssl.a
		${OPENSSL_LIB_PATH}/libcrypto.a
		)

target_link_libraries(MessageProxy
		${LIBWEBSOCKETS_LIBRARIES}/libwebsockets.a
		${LIBCAP_LIB_PATH}/libcap.a
		${OPENSSL_LIB_PATH}/libssl.a
		${OPENSSL_LIB_PATH}/libcrypto.a
		)
		
set_target_properties(MessageProxyStatic PROPERTIES OUTPUT_NAME  MessageProxy CLEAN_DIRECT_OUTPUT 1)

# install target
#asdk_install()
